Part Number Hot Search : 
FKV550T UDN2916B ZX84C5 DD312 SRC1206 P14NK6 BUW50 BLX65E
Product Description
Full Text Search
 

To Download AN4291 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  june 2013 docid024519 rev 1 1/53 AN4291 application note steval385led4ch: four independent high brightness led channels using the stlux385a digital controller introduction the steval385led4ch demonstration board is a complete and configurable solution to manage four independent high brightness led channels using the stlux385a digital controller, which embeds advanced peripherals tailored to generate high resolution pwm signals. the led current is independently regulated by the fixed-off-time (fot) principle on each channel. this document describes how to use the steval385led4ch board, the hardware and the firmware implemented on the board as well as the relevant measurements. the stlux385a shipped with this board has already been programmed with firmware tailored for the steval385led4ch application and the source code is available. the following picture gives an overview of the demonstration board diagram. figure 1. demonstration board diagram channel 1 channel 2 channel 3 buttons dali status uart - + swim stlux channel 0 power in am16703v1 www.st.com
contents AN4291 2/53 docid024519 rev 1 contents 1 demonstration board features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2 getting started with the steval385le d4ch demonstration board . . 8 2.1 first power-on procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3 design concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1 led channel schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.2 solving the equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4 smed implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.1 smed input matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.2 state description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.3 input/output signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.4 smed state time evolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5 firmware implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.1 dimming algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.2 firmware evolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.3 printf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 5.4 low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 6 protection and regulation algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.1 overcurrent protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.2 initial estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.3 adaptive voltage compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.4 software crash protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 7 user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 7.1 control buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 7.2 status leds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 7.3 serial interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 7.4 commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 7.4.1 lc - change led current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
docid024519 rev 1 3/53 AN4291 contents 7.4.2 ll - change led dimming level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 7.4.3 ln - configure led number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 7.4.4 ad - read adc channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 7.4.5 au - adaptive voltage compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 7.4.6 st - verify status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 7.4.7 pw - pwm status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 7.4.8 vp - set v led_pw simulated voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 7.4.9 vc - set v comx simulated voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 7.4.10 wi - cpu load monitor and low power mode . . . . . . . . . . . . . . . . . . . . . 32 7.4.11 dm - dump memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 7.4.12 rr - read memory, single byte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 7.4.13 rw - write memory, single byte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 7.4.14 ed - enable global dimming function . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 7.4.15 di - set global dimming value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 7.4.16 ti - read time counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 7.4.17 co - clear error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 7.4.18 hl - command help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 7.4.19 hl - ? - global help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 7.5 error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 8 measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 8.1 output current precision for different current setup . . . . . . . . . . . . . . . . . 36 8.2 efficiency according to different current setup . . . . . . . . . . . . . . . . . . . . . 38 8.3 current regulation on input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 8.4 current regulation validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 8.5 ocp protection time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 9 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 10 schematic diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 11 bill of material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 12 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
list of tables AN4291 4/53 docid024519 rev 1 list of tables table 1. current, dac, k relation table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 table 2. smed input association . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 table 3. error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 table 4. efficiency according to different current when the input voltage changes . . . . . . . . . . . . . 38 table 5. current regulation discrepancies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 table 6. stlux385a pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 table 7. bill of material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 table 8. document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
docid024519 rev 1 5/53 AN4291 list of figures list of figures figure 1. demonstration board diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 figure 2. power supply connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 figure 3. led string connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 4. schematic - led channel 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 figure 5. smed state evolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 figure 6. smed state evolution.timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 figure 7. dimming channel relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 figure 8. fw timeline evolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 figure 9. console screen during startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 figure 10. ??? command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 figure 11. "st" command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 figure 12. "pw" command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 figure 13. console screen for "ti" command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 figure 14. current regulation - 4 channels at 245 ma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 figure 15. current regulation - same channels, different current setup. . . . . . . . . . . . . . . . . . . . . . . . 37 figure 16. current regulation - same channels, different dimming . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 figure 17. string efficiency based on different current levels - 3 leds for each string . . . . . . . . . . . . 38 figure 18. string efficiency based on different current levels - 6 leds for each string . . . . . . . . . . . . 39 figure 19. string efficiency based on different current levels - 10 leds each string. . . . . . . . . . . . . . 39 figure 20. current regulation vs. v pw_led : 3 leds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 figure 21. current regulation vs. v pw_led : 6 leds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 figure 22. current regulation vs. v pw_led : 10 leds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 figure 23. mosfet gate during short-circuit - 245 ma. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 figure 24. mosfet gate during short-circuit - 738 ma. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 figure 25. mosfet gate during short-circuit - 1.065 a. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 figure 26. schematic - stlux385a - top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 figure 27. schematic - 4 channel led driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 figure 28. schematic power section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
demonstration board features AN4291 6/53 docid024519 rev 1 1 demonstration board features the steval385led4ch demonstration board implements the following features: ? four independent led channels (external leds) ? 3 to 10 leds per channel, connected in series ? average led current independently adjustable from 245 ma to 1065 ma with ~82 ma/step resolution ? led brightness adjustable via pwm dimming (256 steps independent for each channel) ? board power supply voltage (v led_pw ) from 12 v to 48 v based on the longest led string (external ac-dc power supply not included) ? real-time fault detection and protection, such as open or short-circuit, independent for each channel ? board configuration (chain current, led numbers, ?) accessible via usb-uart interfaces ? three buttons to adjust the led brightness for each channel ? two status leds: green = ready-run, red = fault warning: the user is responsible for configuring correctly the board before connecting any led string. the user configures the right values according to the following parameters: ? number of leds connected on each channel (from 3 to 10) ? average led current desired on each led channel (from 245 ma to 1065 ma) ? 200 hz pwm dimming duty cycle for each led channel (from 0% to 100% in 256 steps) ? board power supply voltage (from 12 v to 48 v) the number of leds, the current and the pwm dimming working point can be set through the command interpreter accessible via the serial interface ( section 7.3 ). alternatively, pwm dimming can also be manually adjusted via two on-board buttons. the firmware installed on the stlux385a automatically computes, for each led string: ? primary frequency upper and lower limits (400 khz to 15 khz with frequency step generated by pll @ 96 mhz - auto-setup) ? primary frequency duty cycle depending on the selected current, number of leds and power voltage
docid024519 rev 1 7/53 AN4291 demonstration board features to guarantee the maximum reliability of the demonstration board against the most common led failures, the stlux385a implements the following software and hardware protections: ? for each led string: ? overcurrent ? short-circuit ? led voltage drop falls below the 2.9 v limit ? led voltage drop higher than the 4.2 v limit ? disconnected string (open circuit) ? power voltage outside configured lower / upper limits the stlux385a device drives the 4 led channels (ch0, ch1, ch2, ch3) seen on the right side of the board. the board uses a dc-dc converter to supply the mos drivers (u3, u2) with 10 v, while the stlux385a (3.3 v or 5 v) is powered by a linear regulator. there are three buttons to manually change the dimming period. the dali and uart ttl interfaces are supported. two leds indicate the board status: the green one shows that the system is ?ready? while the red one indicates a system fault or the intervention of a protection mechanism.
getting started with the steval385led4ch demonstration board AN4291 8/53 docid024519 rev 1 2 getting started with the steval385led4ch demonstration board this section aims to help designers to correctly power up and control the demonstration board in a short time. it describes how the board is connected to the load and how the serial command line and the board buttons control the light/color of the led strings. the steval385led4ch board provides 4 independent led channels and the user can connect up to 4 different led chains (not included in the steval385led4ch package). the board is configured to control standard leds with a forward voltage (vf) between 2.9 (" v_lmin ") and 4.2 (" v_lmax ") on each led. the limits are defined in the firmware and they can be changed by modifying the source code (see [ #define v_lmin ] and [ #define v_lmax ] into "led.h"). alternatively, the user can simulate the required voltage drop by configuring, via the (ln command) an apparent incorrect number of leds. the led numbers and the current associated are configured via the serial command defined in section 7.3 . the board accepts a dc input power in the range 12 v - 48 v. the user chooses the correct input voltage depending on the led numbers and the voltage drop. the firmware accepts a minimum voltage of 2.8 v (" v_com_min ") across the inductances when the mosfet is on. if an incorrect power voltage value is set up, the led current is not regulated correctly but the stlux385a prevents the external led module from damage. the only way to damage an external led module is to configure a current over the maximum accepted by the led module or define a number of leds different from those used. when a new led module is applied to the board, it is recommended the user to start with the minimum current ("lc x 0") and with the dimming off ("ll x 0). note that the firmware stores the last serial commands (led number, led current, led dimming and adaptive voltage compensation enable/disable) on the internal e 2 prom and applies those values at power-on or reset. 2.1 first power-on procedure the following section describes a step-by-step procedure, which guarantees a correct power-on during the first configuration of the board. the guide assumes that the following elements are available: ? steval358led4ch board ? usb ttl serial cable shipped with the board ? power supply ? computer running windows ? operating system ? led string it is recommended the led string to be disconnected before the first startup. the first power-on instructions as follows: 1. connect the usb ttl serial cable to the usb port of the computer. windows recognizes the cable as a ttl and launches the driver installation. 2. install the appropriate usb ttl serial cable drivers.the drivers are the "virtual com port (vcp)" and they are provided by ftdi (http://www.ftdichip.com). should you need any help install the drivers, please refer to your it administrator. once the drivers are
docid024519 rev 1 9/53 AN4291 getting started with the steval385led4ch demonstration board installed, the windows device manager panel shows a new usb serial port (comx) device and the com number associated. 3. verify that the power supply output voltage is within the board specification. 4. switch off the power supply. 5. connect the power supply to the board and check the input polarity. the following picture illustrates how to connect the power cables: figure 2. power supply connection 6. power on the board and check that the power supply current level is within the appropriate levels. 7. monitor the red status led on the steval358led4ch demonstration board. during the startup, the red status led goes on for few seconds before switching off. should the red status led stay on for more than 3 seconds, the stlux385a device is indicating a problem. the status led should be checked after every step of the power- up procedure. the stlux385a indicates any issue encountered: short-circuit, overcurrent, input power under the limit, etc. note that, once the status led is red, it can only be switched off via the "co" console command. 8. connect the usb ttl serial cable to the steval358led4ch board. 9. run hyperterminal or an equivalent program from the computer connected to the usb ttl serial cable. the connection configuration is as follows: ? baud rate 115200 ? data bits: 8 ? stop bits: 1 ?parity: no ? flow control: no handshake in order to verify that the connection is valid, type "?" and press enter. if the link is ok, the stlux385a list of commands is displayed. 10. should the red status led list a problem, use the "st" command and look at ta ble 3 to find the root of the problem. 11. configure the led string parameter via the "lc" (led current) and "ln" (led number) commands. see section 7.3 for the command reference. note that any new setting is stored in flash and is automatically used during the next startup.
getting started with the steval385led4ch demonstration board AN4291 10/53 docid024519 rev 1 warning: the current level has to be configured according to the led capability. a current level higher than the one supported by the led may damage the led itself. 12. switch off the dimming using the "ll x 0" command where "x" is the channel number selected to drive the led string. once the dimming is disabled, channel x doesn?t generate current. 13. connect the led string to the appropriate channel "x" connector. please observe the led polarity. the following picture illustrates how to connect a led string. figure 3. led string connection 14. increase the dimming level using the "ll" command and observe the led string switching on. 15. enable the adaptive voltage compensation using the "au x 1" command.
docid024519 rev 1 11/53 AN4291 design concept 3 design concept the steval385led4ch demonstration board is based on a modified buck topology (reversed buck) and the fixed-off-time (fot) principle is used to regulate the current into each led string. the advantage of the fot principle is that the high frequency current ripple and, therefore, the average led current depend only on the off-time and the led output voltage. with a fixed-off-time, the output voltage depends on the temperature and the number of leds. to compensate this effect, the stlux385a implements the adaptive voltage compensation algorithm, which constantly monitors the led voltage drop and adjusts the off-time. the input voltage variations do not affect the average current.the average led current is directly controlled by regulating the led peak current (configurable), which is sensed during the mosfet on-time. while the off-time parameter is fixed, the on-time is a function of the time that the current takes to reach the selected level: this time depends on the led current, power voltage and led voltage. the firmware implements the following two functions to compute the off and on-time: equation 1 equation 2 where: ? v led : output voltage of the led string (equal to v led_pw -v comx signals on the schematics) ? i max : maximum (peak) current imposed by user and defined by table 1 (near 92 ma/step) ? i avr : current imposed by design (i max - 10%) ? l: inductance imposed by design (470 h) ? v led_pw : input voltage present at the main power pin the on-time calculated in equation 2 has to be considered as an ideal value: the real one is actually a consequence of the triggering of a comparator monitoring the peak value of the led current. for this reason, a percentage of the calculated on-time is added (t x ). this is empirically imposed by adding 20% to the on-time and doubling the resulting value. equation 3 equation 4 t off 2i max i avr ? () () l v led -------------------------------------------------------- - = t off 2i max i avr ? () () l v led_pw v led ? -------------------------------------------------------- - = t on max () t on t x + () 2 = t on max () t on t on 0.2 () + () x2 2.4xt on ==
design concept AN4291 12/53 docid024519 rev 1 where t x is the time to search current and it is equal to 20% of t on . the extra time has two effects: the former, during the dimming operation, allows a quicker response from off to on transition; the latter prevents a frequency lower than 15 khz (in the audible spectrum). on the board the circuit for the transition mode principle is also present but it is not described in this manual. 3.1 led channel schematic to implement the fot principle and to use the stlux385a microcontroller, the following schematic (single led chain) is used. it represents a standard reverse buck structure. the stlux385a applies the pwm frequency via the p wm0 signal and monitors the voltage of the v com0 signal. it also monitors the led current during the "on-time" by sensing the voltage present at cpp3 line. the v led signal is calculated by the subtraction from v led_pw and v com0 . the v com0 signal is acquired 100 s after the pwm dimming starts. the schematic for a single led channel is reported in figure 4 : figure 4. schematic - led channel 0 explanation: ? the led chain is connected to the j6 connector. ? the mosfet q2 drives the current from led_pw to the led channel and the inductor l3, charging it. the inductor l3 is defined for all selectable current ranges. should the user change the inductor values, some parameters, described in this manual, such as the k constant, have to be recalculated. ? the resistors r28 and r29 act as shunt resistor to sense the current through the leds. the current signal is then fed to cpp3 pin through an rc filter represented by the resistor r23 and the capacitor c14. the filter removes the spike caused by the turn-on current generated by mosfet q2. the stlux385a detects the peak current by comparing cpp3 with an internal, dac generated, voltage. ? the r19, r25, q4 and r37 are used to feed the voltage of the led chain cathode to the stlux385a's adc. the mosfet q4 is used to prevent the small biasing current cpp3 l3 470uh 1,2a sat 1 2 pwm0 r29 1r8 1w 1% from 240 ma to 1 a c11 100nf 100v u2 pm8834 1 2 3 4 5 6 7 8 en1 pwm1 gnd pwm2 out2 vcc out1 en2 c16 10nf gnd d6 stps0560z rs-250-347 1 2 cpp3 j6 ch0 1 2 gnd gate_pwm0 gnd cut freq = 723 khz v com0 led_pw 82 ma step + vd_10 r39 5k1 tp19 - gnd d4 stps2h100a rs-249-612 2 1 pwm0 gnd r28 1r8 1w 1% gnd led_pw gate_pwm0 c14 1nf q4 2n7002 1 3 2 r25 26k1 d8 ll4148 gnd gate_pwm0 + c12 1uf 100v r19 26k1 q2 stn3nf06l 1 2 3 4 gnd v com0 r37 1k2 r23 160r r21 10r c18 10nf gnd gnd am16704v1
docid024519 rev 1 13/53 AN4291 design concept of the voltage divider from flowing through the led during the dimming off-time. the adc maximum voltage is 1.25 v (the adc gain is configured to x1). ? the d4 diode is active during the off period, when the voltage across the inductor goes high. ? the u2 circuit (pm8834 mosfet driver) is used to generate the correct gate voltage in case the stlux385a is powered from 3.3 v. ? the d6 diode is used to protect the circuit if the led chain opens or is accidentally removed during the normal operation. 3.2 solving the equations the t off value introduced in the previous equation has to be converted into a number that could be used by the stlux385a. in particular, t off is implemented in the smed as a timer. this timer is a 16-bit register and is clocked according to the smed clock (clk = 96 mhz). the timer register value is equal to: equation 5 where: ? t off(smed) : timer value ? clk: smed operating frequency the stlux385a monitors the voltage drop caused by the led and it is calculated as the difference between the power voltage (v led_pw ) and the voltage measured after the led string (v comx ). both v led_pw and v comx are read by the adc unit. equation 6 where: adc led_val : the sensed led drop voltage and calculated as v led_pw - v comx v comx : adc value read from middle point of each channel (led-inductor) v led_pw : adc value read from the main power p: is the resistor partition gain (r 19 +r 25 +r 37 )/r 37 = (53400)/1200= 44.5 adc fs : adc top voltage = 1.25 v adc top : is the step value of adc (2 10 ) = 1024 equation 1 can be rewritten as follows: equation 7 t off smed () t off clk = v led adc led_val adc fs p adc top -------------------------------------------------------------------- = t off smed () 2i max i avr ? () l adc top adc led_val adc fs p -------------------------------------------------------------------- ?? ?? clk =
design concept AN4291 14/53 docid024519 rev 1 for example: equation 8 where: ? i max : max.current imposed through the dac setup (1/16) ? i avg : average current - imposed as 90% of i max (by design) ? (i max - i avg ): current difference: (i max *0.1) ? i: is the inductance value = 470 10 -6 h (by design) ? clk: is the smed clk = 96 10 6 hz the average current i avg is set by design to be equal to 90% of i max .the algorithm controls the current to be centered in i avg , with a ripple equal to +/- 10% of i max . in equation 8, the current and the voltage across led are unknown. the current (i max ) is an input value defined by the user. the voltage on the led string is the difference between the main power voltage and the v comx voltage sensed by two adc channels. considering 1.184 a i max current and i avg approximated to 1.066 (the real value is 1.0654), the equation 4 is expanded into: equation 9 where k (196763 in this case) is a constant for the given led current selected by the user. the i max values accepted by the steval385led4ch board are bounded by the dac limits as shown in the following table: table 1. current, dac, k relation table index dac value medium current (1) maximum current k (dec) 10 13 (0x0d) 1065 ma 1184 ma 196.763e+03 9 12 (0x0c) 984 ma 1093 ma 181.628e+03 8 11 (0x0b) 901 ma 1002 ma 166.492e+03 7 10 (0x0a) 819 ma 911 ma 151.356e+03 6 9 (0x09) 738 ma 820 ma 136.221e+03 5 8 (0x08) 648 ma 729 ma 121.085e+03 4 7 (0x07) 574 ma 638 ma 105.949e+03 3 6 (0x06) 492 ma 547 ma 90.814e+03 2 5 (0x05) 410 ma 456 ma 75.678e+03 t off smed () 2i max i avr ? () l adc top clk adc led_val adc fs p ---------------------------------------------------------------------------------------------------- - = t off clock () 2 1.184 1.066 ? () 470 10 6 ? 1024 96 x10 6 adc led_val 1.25 44.5 ------------------------------------------------------------------------------------------------------------------------------- ------ - = = = 196763 adc led_val ------------------------------ - k adc led_val ------------------------------ - =
docid024519 rev 1 15/53 AN4291 design concept the index level is used by command "lc"(see section 7.4.1 ) to select a current value. the output of equation 9 is the value to be stored in the smed register that represents t off . since k is constant, as long as the user doesn't change the current index level, the stlux385a updates the t off value only when the adc led_val changes, when the led voltage drop changes. the only operation required to update t off is a 32-bit division. equation 4 can be developed as follows: equation 10 since "k" is constant during operations, t on(max) can be updated with a single 32-bit division. smed implements the t on(max) timer as two consecutive timers operating in different states (s1, s2).the overall update of t on and t max timers requires 3 divisions plus the time to update the relevant smed shadow registers.the stlux385a needs just 200 s to complete the operation.the "k" parameters are calculated to satisfy a board operating with a 12 v - 48 v input power range and support from 3 to 10 leds. should the user use either different inductances or different parameters such as the i current, only the "k" constant has to be recalculated and the fw has to be updated with the new k indexes. 1 4 (0x04) 329 ma 364 ma 60.543e+03 0 3 (0x03) 245 ma 273 ma 45.407e+03 1. medium current: the value has been approximated to the nearest unit. table 1. current, dac, k relation table (continued) index dac value medium current (1) maximum current k (dec) t on max () t on 2.4 2i max i avg ? () ladc top clk adc vcom_val adc fs p ---------------------------------------------------------------------------------------------------- - 2.4= == = 2.4 k adc vcom_val -----------------------------------
smed implementation AN4291 16/53 docid024519 rev 1 4 smed implementation this section describes how the fot (fixed off-time) principle is implemented in the smed (state machine event driven). each smed generates the correct pwm signals and the smed state evolution depends on both external events and internal timers. note: please refer to the stlux385a product documentation for a detailed explanation of the smed technology. the smed is responsible for the generation of the pwm necessary to maintain the i avg current through the leds. when the smed is triggering the pwm output, the leds are on. digital dimming is achieved by applying a duty cycle to the leds. the software controls the duty cycle (referred as dimming in this document) by suspending and restoring the smed's pwm generation. when the smed stops triggering the pwm line, the leds are off. note that the dimming frequency is much lower (~200 hz) than the pwm frequency used for current control (70 khz - 400 khz). 4.1 smed input matrix each smed has three associated signals. only two inputs are used in the fot principle described in this manual. the inputs have been logically mapped to represent: ? smed_in(0) - digital input: senses the inductor null current (currently not used). ? smed_in(1) - comparator input: detects when the current has reached the dac value. ? smed_in(2) - software input: starts and stops the smed. used for dimming control. ta ble 2 summarizes the input and event relationship: option: ? smed 4 pwm output is optional. ? smed 5 pwm output is filtered and connected to cpm3. smed5 may be optionally used to generate a reference signal for the cpm(3) input. cpm3 can be used to sense and detect the top-current event for led channel 0 and increase the string average current granularity.the possible current steps are equal to 5 ma (typical). this option is not used in the current firmware version. table 2. smed input association led ch smed_in(0) smed_in(1) smed_in(2) smed 0 0 digin 2 dac-cpp 3 sw 0 smed 1 1 digin 1 dac-cpp 2 sw 1 smed 2 2 digin 4 dac-cpp 0 sw 2 smed 3 3 digin 3 dac-cpp 1 sw 3 smed 4 not used digin 0 sw 4 smed 5 not used sw 5
docid024519 rev 1 17/53 AN4291 smed implementation 4.2 state description the steval385led4ch demonstration board uses four independent smeds, one for each led string. all the smeds use the same configuration and share the same control algorithm. this section describes a single smed but the same principles are applied to all the smeds. the following diagram shows the smed state evolution: figure 5. smed state evolution a state is defined by the sx symbol while a transaction between two states is represented by a line. a transaction is generated by an event, displayed as text on the line. the event tim_cnt (x) is generated by the timer when it reaches the value configured in state x. an event(line) represents an event generated by the input line. the inputs associated to a smed are defined in section 4.1 . each smed has 3 associated events, marked as event(line) in figure 5 . each event can be: type event_seq or event_jmp. while event_seq events push the state machine to the next sequential state, event_jmp allows the state machine to reach any state. s0 s1 s2 s3 idle hold s0 tim_cnt(2) or event(1) tim_cnt(1) tim_cnt(0) event(1) - on event(2) - on event(2) - off start tim_cnt(3) interrupt on exit am16705v1
smed implementation AN4291 18/53 docid024519 rev 1 each state is here described: ? idle: initial state this is the smed initial state. the pwm line is set to 0 to keep the mosfet off. the next state is s(0) and it is automatically entered when the smed starts. on exit: clear timer and set pwm to on. ? s(0): off-time this state implements the fot time and the output pwm line is set at 0 v. s(0) enters the hold state when the swx bit (event 2) is set to 0 or it goes to s(1) if the timer reaches the fot time. the smed timer is cleared on exit. event_jmp = hold jump on = event(2). event_seq = tim_cnt. on exit: clear timer and set pwm to on. ? s(1): fault zone this state is used to prevent damages due to an external malfunction (either a hardware problem or an extreme fluctuation of the input voltage). the pwm output line is set high during the transaction between s(0) and s(1) and turns the mosfet on, leaving the current flow through the leds and the sense resistor. in normal conditions, the current shouldn't reach the peak during s(1) and the s(2) timer overflows, pushing the smed to s(2). the s(1) time is set to be equal 33% of the total t on state (s(1) + s(2)) maximum time. in exceptional conditions, the cppx signal arrives earlier, the s(1) timer expires and the smed evolves to s(3) (ocp). cppx indicates the overcurrent in the circuit. the smed timer is cleared on exit. event_jmp = event(1). event_seq = tim_cnt. on exit to s(3): clear smed timer; set pwm to off. on exit to s(2): do not clear smed timer; turn on the pwm output. ? s(2): current limit this state is used to find the current peak in normal conditions. the current peak is imposed by the voltage configured on the dac. when the cppx event is detected, the smed advances to the s(0) state. during this state, the output pwm line is high and the mosfet is on. a timer overflow indicates that the current has not reached the selected peak, for example because the led string is not attached. this time is computed by the (66% + 20%)*2 equation 3. on exit, the pwm output is set to 0 v, switching off the mosfet. the next state is the non-sequential state s(0). event_jmp = n/a. event_seq = event(1) or tim_cnt ("and/or" bit guarantees a non-sequential jump). on exit to s(0): reset timer, set pwm to 0. ? s(3): overcurrent protection when event_jmp is received during state s(1), the smed has found an ocp (overcurrent protection) event and goes to s(3). during the transaction, the pwm output line is set to 0 v in order to turn the mosfet off. the s(3) timer is set to its maximum value (0x1f0 = 5 s) to protect the hardware. when the smed timer overflows, the smed advances to sequential s(0) state. the transaction also
docid024519 rev 1 19/53 AN4291 smed implementation generates an internal interrupt and the software can monitor the ocp and stop the smed evolution. event_jmp = n/a. event_seq = tim_cnt. on exit to s(0): reset timer, generate sw interrupt. ? hold s(0) this state starts from s(1) when the software needs to stop the smed evolution, due to the dimming duty cycle off time. hold is also used when ocp is detected during s(1). the pwm output line on hold state is 0 and the mosfet is off. when the fw sets the swx bit to 1, the smed goes back to s(1). note: the register associated to the smed is updated when either the smed is on hold state (during the dimming off-time) or the output pwm line is zero (s0 state).this approach guarantees that the pwm output is always set to 0 when the new parameters are applied. 4.3 input/output signals the smed uses the following list of input/output signals and pins: ? pwmx: pwm output signal the signal is fed into the mosfet's driver input to control the mosfet's switching state. the pwm operates according to the t on and t off time faced in section 2 . when the pwm is high, the mosfet is on and vice versa. when the supply voltage of the stlux385a is 5 v, the output signal can be directly connected to the mosfet. instead, when the supply voltage is 3,3 v, the pm8834 buffer is required. ? cppx: comparator input signal cppx receives the current sense signal and compares it to the internal dac value. when the voltage on cppx pin is higher than the dac value, the output of the internal analog comparator goes high, and vice versa. the comparator output is the event(1) internal signal. event(1) is programmed at level mode so that the smed can detect immediately the eventual anomaly during s(1). if edge mode was used and the anomaly happened outside s(1) then s(1) wouldn't receive the edge event. there are only two smed states that check for this event: fault zone (s1) and current limit (s2). ? swx: software event used to start and pause the smed. when the smed is paused, the pwm output has to be set to 0. the swx event is used during s(0) to pause the smed and during hold to restart. the event is programmed at level mode and is used by the software to define the dimming duty cycle period. thanks to the event mode, the sw trigger is detected by s(0) even if the sw edge happens while the smed is in a different state then s(0). in this case, the smed completes the cycle, reaches s(0), captures the sw level and goes on hold. ? diginx: zero current detection the pin is used for zero current detection while it is in transition mode. at the moment the transition mode is a proposal and the pin is not managed. ? v com0 the voltage applied to the pin is read by the stlux385a adc and it is used to compute the t on time and the t off time. the voltage is captured 100 ns after the
smed implementation AN4291 20/53 docid024519 rev 1 beginning of the on portion of the dimming cycle as the current is expected to reach the correct value. ? v led_pw the voltage applied to this pin is read by the stlux385a adc and is used to compute the t on time and the t off time. it is acquired at the same time of the v com0 voltage using the 8 values, four for v com0 and four for v led_pw - interleaved, stored by the adc in registers adc_dath< 7-0 > and adc_datl< 7-0>. 4.4 smed state time evolution the following diagram describes the smed state time evolution. only one pwm period is illustrated. figure 6. smed state evolution. timing the colors identify the case of a correct or incorrect situation: ? the black trace is the output current observed during a correct setup where the smed evolution is triggered by timer events only. in this case, no event_seq or event_jmp are received; note that s2 may not have reached the peak level during s(2). ? the blue trace represents the situation where the current reaches the limit point (event_seq) during s(2). ? the red line shows the smed evolution when an ocp event (event_jmp) is detected during s1. the smed is programmed to generate an interrupt when an ocv condition happens. the main program receives the interrupt and stops the smed. state idle s(0) pwm time current s(1) s(2) s(0) fault zone current limit off time fixed- 33% t on 132% t on +20% current limit fault ocp ok ok s(4) off time fixed- am16706v1
docid024519 rev 1 21/53 AN4291 firmware implementation 5 firmware implementation the following section offers a view of the firmware implementation. for more details about the firmware, refer to the source code. the compiled portion of the firmware core is 3.5 kbyte and the code size is ~12 kbyte. most of the code size is allocated to the debugging machine and general user interface (see section 7.3 ). the pwm algorithm and the ocp controls are entirely implemented in the smed block, leaving the cpu free for control tasks such as: slow varying algorithmic compensations, the command line, and interrupt management. 5.1 dimming algorithm the dimming algorithm controls the brightness of the led string by modulating the amount of time, the led is switched on during a ~5 ms period. this period defines the dimming cycle, which operates with a ~200 hz frequency. the longer the led is on during a single cycle, the brighter the led results to human eyes. to turn on a led, the algorithm simply activates the smed associated by setting the smed's swx event to active state. once the desired on-time period is passed, the led is turned off and the algorithm waits for the beginning of the next dimming cycle to turn on the led again. to optimize power, the dimming cycle in channel x is 90 degrees shifted respect to channel x-1. led chains can be configured with different on-time length; however the dimming start period is fixed by design. in this way, the leds are always turned on at different times, reducing current peaks on the power supply. the led on-time is instead a multiple of 20 s and is based on the stmr timer, which itself has 1 s granularity. the software stores the time-on length in the onoff[8][2] structure, where the first byte indicates the channel and the pwm action (turn on or off the led) and the second byte specifies the time (up to 256 time units = 256 x 20 s = 5120 s) before the next event. the next example shows the activity of led channels with different dimming on-times: dimm1 is active at 87,5%, dimm2 is active at 25%, dimm3 is active at 75% and dimm4 is active at 37.5%. when the dimming is on the smed output pwm is active and the led light is on.
firmware implementation AN4291 22/53 docid024519 rev 1 figure 7. dimming channel relation 5.2 firmware evolution the following section describes the software timing characteristics as shown in the following picture. the picture shows the relationship between two consecutive stmr_isr() routines and the other principal subroutines. the colors define if the routines run in interrupt mode (colored) or are called from main (black). the pmw1_on line is the dimming period: when the line is high, the pwm signal is high too. figure 8. fw timeline evolution the lines are here described: ? stmr_isr() : stmr timer interrupt. the stmr timer has a granularity of 20 s (stmr unit). the timer is used to start and stop the dimming period for each smed and triggers the swx bit on the msc smswev register. on every interrupt, the timer is reprogrammed so that the next 1/200 hz = 5 ms dimm1 time t8 t0 t2 t4 t6 t0 dimm2 dimm3 dimm4 t2 t4 t6 t0 t2 1/200 hz = 5 ms am16707v1 1/200 hz = 5 ms pwm _ 1on time t0 adc_isr() get_key() stmr_isr() not in scale comp_pwm () smedx_isr() comp_duty() awu time am16708v1
docid024519 rev 1 23/53 AN4291 firmware implementation interrupt is received when the next dimming even is required, as specified in the onoff[][] structure. when the interrupt routine sets a smed on, the startup flag for the adc delayed acquisition (using the awu peripheral) is also set. ? smedx_isr() : smed interrupt the interrupt is used to stop the smed when an ocp problem is detected. the interrupt is generated by a smed on exit from s3. the smed is in s3 only if event(1) is received during s1. the interrupt routines stop the smed by changing the swx bit and giving the fault signal to the main function, which turns on the red "fault" led. the smed is reactivated on its next dimming cycle and if the ocp problem is not removed then the smed evolves into s3, triggering the smedx_isr interrupt again. auto-wakeup unit. the auto-wakeup unit is used while the cpu waits for the current startup and led voltage settlement time before starting the adc acquisition. for a correct fot implementation the adc measures the v comx voltage when the pwm is on and when the v led has a correct value. this time is fixed to around 100 s after the smed start. when the awu time expires, the interrupt starts the adc channel acquisition. ? adc_isr() : adc interrupt the routine samples, for each channel, v led_pw and v comx , 4 times respectively. the values are then averaged and stored. the adc sampling routine occurs 100 s after the start of the pwm dimming. should the pwm dimming time be smaller than 100 s, the adc samples incorrect voltage values and therefore the samples are discarded. this protection (inconsistent voltage protection) is implemented via the smed_active bit. the interrupt routine uses the adc_eoc flag to inform the main function that the adc operation is completed and that new data is available. as a consequence, the software discards the adc value. the interrupt routine uses the adc_eoc flag to inform the main function that the adc operation is completed and that new data is available. ? get_key() this routine is used to detect if the board buttons are pressed. the stlux385a uses the adc (adcin[7], pin 31) to sense the button status. since the adc is used also to read v comx and v pwr , a protection is set to avoid conflicts. ? comp_pwm() it computes the new smed?s operating parameters as calculated by the adaptive voltage compensation mechanism.the new values are updated on the smed registers only during the next stop phases (using the upd_flags variable with upd_pwmx flags). ? comp_duty() this routine is invoked when the user changes the dimming period. the routine computes a new dimming period based on the ontime[] structures and stores the result on tmp_onoff[][] structures. the update is performed at the beginning of the next dimming period (using the upd_flags variable with upd_duty flags) and when the dimming is off. during the update, the tmp_off[][] structure is copied into the onoff[][] structure. the tasks displayed in the previous picture refer to the pwm and dimming control operations only. the stlux385a firmware handles other tasks such as the command line,
firmware implementation AN4291 24/53 docid024519 rev 1 which uses two interrupts to read or write characters to the serial line. the serial interrupts use the lowest priority level among all the other sources (stmr, awu, smed and adc). 5.3 printf the stlux385a firmware implements the standard " printf() " subroutine, which takes several cycles to expand the printed strings and the operation delay real-time events. it is suggested the use of " printf " in production code is minimized or removed. 5.4 low power modes the stlux385a may enter low power modes through the instruction wfi (wait for interrupt), where the internal cpu is stopped until an interrupt is received. the "wi" console command instruction allows the user to use the wfi instruction (see section 7.4.10 ). the user may implement more aggressive low power schemes via new software routines. for example, the stlux385a power consumption efficiency could be increased by disabling the smeds and the 96 mhz pll while the led string is completely switched off.
docid024519 rev 1 25/53 AN4291 protection and regulation algorithm 6 protection and regulation algorithm this section describes the protection and regulation algorithms implemented in the stlux385a. every channel is independent from the others and the same logic applies to all channels. the stlux385a implements software and hardware protections aimed to preserve the external hardware in case of abnormal events or variations. the stlux385a doesn't need external active analog circuitry on the board as the firmware replaces them. once an error is recognized, the fw stores the error code and keeps sensing the system to verify that the problem has been fixed. the error code can be verified typing the "st" command (see section 7.4.6 ). protections can be summarized according to different priority levels. 6.1 overcurrent protection the overcurrent protection (ocp), which preserves the external circuit from damage due to a component fault, is the most important protection and requires a short detection and reaction time. the stlux385a implements ocp directly in the smed hardware (through states s1 and s2) and doesn't require any high priority firmware intervention.the internal smed clock guarantees a detection time of ~10 ns (fck_smed = 96 mhz) however the external circuit response time pushes the overall detection time to 200 ns. when an ocp is detected, the smed stops its pwm output and generates an interrupt. the firmware can then execute the recovery procedure by periodically restarting the pwm line. 6.2 initial estimation during the startup phase, the input power voltage is monitored by the set_check_v() routine. this routine reads the power voltage (on adc channel zero) and stores it into the global variable vpwr[] . the voltage read back is stored into all channel locations (0 to 3). the routine set_check_v() estimates the voltage drop generated by the leds by using the number of leds as specified by the user and the maximum and minimum predefined led voltage drops. the following formula is used: equation 11 where x is the led channel. the estimated voltage drop is used for the initial calculation of the t off and t on values. 6.3 adaptive voltage compensation the adaptive compensation is a technique that monitors the system and changes the operational parameters to guarantee that the configured average current always flows through the led. as the average current depends on the t on and t off values, the stlux385a recalculates the values at the beginning of every dimming on cycles. the adaptive compensation is activated with the serial command "au x 1". wk_volt x [] .min_vl wk_volt x [] .max_vl + 2 -------------------------------------------------------------------------------------------------------------
protection and regulation algorithm AN4291 26/53 docid024519 rev 1 the vpwr[x] and vled[x] voltages are updated by the check_v() routine on every dimming cycle. the voltages are read from the corresponding adc channel 100 s after the beginning of the dimming on phase. this time offset guarantees that the led are receiving the correct amount of current. when the adaptive compensation is inactive, the vpwr[x] and vled[x] variables are not updated and store the voltages updated either during startup or before the compensation is disabled. when the adaptive compensation is inactive then the user can update the vpwr[x] and vled[x] variables via the serial line ("vp" and "vc" command). the check_v() subroutine checks that: ? the pwm signal is off when the adc completes the operation; all the adc readings are discarded. this situation can happen during an ocp situation where the current peaks before the 100 s limit. ? the vpwr[x] voltage is lower than the vmax_50 constant (maximum power voltage). if it is high, the err_max_v error flag is set. ? the vpwr[x] voltage is higher than the minimum imposed by the number of leds ( wk_volt[i].min_vcc ). otherwise the err_min_l error flag is set. ? the common voltage point is higher than the minimum voltage imposed by the v_com_min constant. the value of v_com_min constant is 2.8 v. otherwise the err_min_l error flag is set. ? the voltage across the led is within the minimum ( wk_volt[i].min_vl ) and maximum ( wk_volt[i].max_vl ) values defined by the number of leds. should the voltage across the led be out of this range, then the err_min_l error flag is set. a) the 100 s delay is achieved using the auto-wakeup (awu) feature provided by the stlux385a. b) should smed4 be available and not connected to a led string, it can be used to generate the delay for the adc measurement. this leaves awu free for other purposes. c) the two voltages vpw[] and vled[] are acquired on each dimming on phase, four times alternately (ch0, ch1, ch0, ch1, ch0, ch1, ch0, ch1, ch0). the automatic adc sequential measurement is a unique stlux385a feature. when the compensation is active, the comp_pwm() routine calculates the t on and t off based on the most recent voltage measurements. should the resulting frequency be out of the designed range: ? the t on and t off values are not updated. ? a single conservative t on - t off period (t on [max]=3 s, t off = 5 s) is applied during the actual dimming on cycle. ? the error err_max_f or err_min_f is risen. ? the previous t on and t off values are applied to the next dimming on cycle. from the application point of view, the led frequency is bounded to this prevent excessive dissipations or audible noise. 6.4 software crash protection a final protection is used to prevent deadlock and software crashes and it's implemented via the watchdog timer (iwdg). the watchdog is reset in the main function and must be refreshed at least every 10.4 ms, otherwise the reset signal is internally generated to solve the lock-up situation. in the current software implementation, the " printf " routine also refreshes the iwdg timer due to the long time required to process strings.
docid024519 rev 1 27/53 AN4291 user interface 7 user interface 7.1 control buttons the steval385led4ch demonstration board features three buttons, used to manually change the dimming duty cycle. the buttons can be configured to operate in two different ways and their behavior is controlled via the "ed" command. holding a button causes its action to continue. single channel dimming: when the "ed" command is off ("ed 0"), the buttons behave as follows: ? "led ch sel": selects a channel. the new selected channel blinks once. ? "inc": increases the dimming duty cycle on the selected channel. ? "dec": decreases the dimming duty cycle on the selected channel. multichannel dimming: when the "ed" command is on ("ed 1"): ? the button "led ch sel" is not used. ? the button "inc" increases the dimming duty cycle on all channels. ? the button "dec" decreases the dimming duty cycle on all channels. the three buttons are read by the adc channel line 7. 7.2 status leds there are two status leds attached to the board: ? green led (status): the green led is active when the input power is correct and the stlux385a is running. the led can also act as a firmware performance monitor and show the cpu usage. the performance mode is enabled by the "vi" instruction (see section 7.3 ) and the led toggles as follows: ? led on: cpu running ? led off: cpu sleeping ? red led (failure): the red led is used to report an error or the intervention of a protection to preserve the hardware. once the red led is on, the only way to clear is to use the "co" command (see section 7.3 ). 7.3 serial interface this section describes the terminal interface line available on the stlux385a firmware. the serial line allows the configuration of the: ? working point of the led channel ? current level ? led numbers ? dimming percentage it also allows the device internal status to be inquired. the stlux385a command line interface is accessible via a standard terminal utility installed on the user's pc.
user interface AN4291 28/53 docid024519 rev 1 the serial (ttl 0 - 3.3 v) cable is shipped together with the demonstration board. the on board connector is identified as uart i/f. the serial line uses only three lines: gnd, tx, rx, the baud rate is 115200, no parity, 8-bit, 1 stop bit, no handshake. the user should identify the pc com line number, please refer to your local it department if the com number is difficult to retrieve. the pc also installs the serial com drivers as soon as the cable is connected. if the driver is not installed, please call your it support. warning: the command line executes all the commands entered. the user has the responsibility to use the correct commands as per circuitry adopted. for example, should the user configure 1 a current through a 300 ma led chain, the leds could be damaged. the stlux385a, during power-up and reset, sends the following strings to the serial line. the strings are received and displayed on the console: figure 9. console screen during startup this message is used to verify that the link between the pc and the stlux385a is up and that the correct baud-rate is selected. the strings "vxrx" report the firmware version and revision and, on the next line, the time and the date during the compilation process. "ready" appears when the stlux385a chip is ready to receive a command. at this point, the user can interact with the stlux385a using one of the following commands. note: the command list is shown by the "?" command. evalstlux385 - 4chled vxrx build jan 20 2012 14 : 00 : 44 ready am16709v1
docid024519 rev 1 29/53 AN4291 user interface figure 10. ??? command every command is composed of two parts: the command prefix (normally two characters) and the command fields. any incorrect typed character can be changed using the backspace character. each led channel is identified by the channel (ch) number only (from 0 to 3). 7.4 commands the following section describes the commands accessible through the console. 7.4.1 lc - change led current the command is used to change the current in the specific led chain. the configured value is stored into the e 2 prom data area for its read-back and applies to next power-on. syntax: lc [ch] [i] parameters: ? ch [0-3]: the led string channel value. ? i [0-10]: current index as shown in table 1 . it represents the peak of the chain current and the index ranges from 0 (273 ma) to 10 (1184 ma). output: none example: lc 2 3: configures channel 2 to use 492 ma mean current. monitor channel command lc [ch] [i] setup led current [0 - 10] for channel [ch] ll [ch] [0; 6 - 256] setup led dimming for channel [ch] ln [ch] [num] setup led numbers [3- 10] for channel [ch] ad [ch] get adc channel [0- 7] value au [ch] [0,1] control [ch] loop, 1=en. 0=dis st get status pw [ch] get pwm status on channel [0 - 3] vp [ch] [0 - 1023] simul. pow voltage on channel [0 - 3] vc [ch] [0 - 1023] simul. common voltage on channel [0 - 3] wi [0,1] enable [1], disable [0] the wfi instruction dm [add] [len] dump register/memory rr [add] get register/memory rw [add] [dat] write register/memory ed [0,1] enable [1] disable [0] global dimming key/cmd di [value] globally dimming the light to [0- 100]% ti get time co clear ovc flag hl [??] help cmd [??] string hl get help ? get help use [enter] to end line, use [backspace] to delete char am16710v1
user interface AN4291 30/53 docid024519 rev 1 7.4.2 ll - change led dimming level to change the led dimming level, use the "ll" command. the value is stored into the e 2 prom data area for its read-back and applies to next power-on. syntax: ll [ch] [level] parameters: ? ch [0-3]: the led string channel value. ? level: [0-256]: indicates the dimming level in a scale from 0 (off) to 256 (always on), a value between 1 (0.4%) and 255 (99.6%) indicates the dimming level. a value of 256 turns the led chain on at full brightness (100%). when the global dimming level is different from 100% (via "ed" and "di" command), the equivalent current on example is equal to ('level / 256)*(global dimming level). output: none example: "ll 3 200": sets up channel 3 to use a current equal to 200/256 of the maximum current defined by the "lc" command. 7.4.3 ln - conf igure led number used to setup, before connecting any led, the number of leds used in a specified chain. the value is stored into the e 2 prom data area for its read back and applies to next power- on. syntax: ln [ch] [num] parameters: ? ch [0-3]: the channel number. ? num [3-10] the number of leds. the minimum led number is 3; the maximum led number is 10. output: none example: "ln 1 6": sets up six leds on the channel 1. 7.4.4 ad - read adc channel reads the adc channel [ch] and displays the result in decimal value. syntax: ad [ch] parameters: ? ch [0-7]: adc channel number. for the adc channel association, see the board schematics. output: ? the output value is the decimal conversion read from the adc channel. the value read from the led channel (v comx point) depends on the dimming level. the correct input voltage at the stlux385a pin is given by the adc value multiplied by 0,001221896 [= (1.25/((210)-1))]. for channels 0, 1, 2, 3, 4, 6, the adc value has to be multiplied for 0.05437489. example: "ad 0": reads the power line voltage.
docid024519 rev 1 31/53 AN4291 user interface 7.4.5 au - adaptive voltage compensation the adaptive voltage compensation (control loop) is used to calculate the new pwm parameters in relation to the voltage read by the v comx or v led_pw . when the adaptive voltage compensation is off ("au x 0"), the voltage compensation simulation mode is enabled and the commands vp and vc become available. the value is stored into the e 2 prom data area and applies to next power-on. syntax: au [ch] [enable] parameters: ? ch [0-3]: channel number ? enable [0,1]: enables (1) or disables (0) the adaptive voltage compensation. output: none 7.4.6 st - verify status the command reports the stlux385a status. syntax: st parameters: none output: an example of the output is shown: figure 11. "st" command the first line reports the last error [err=] and the total number of errors found [cnt=] by the fw. the [di=] field reports the "ed" status [0 or 1] and the "di" global dimming percentage (from 0% to 100%). it also reports, for each channel [ch], the channel activation or deactivation [on or off], the automatic loop status [l=1 or l=0], the dimming level [d=010], the number of leds, the current index and the v led_pw and v comx voltages when the dimming is on. the voltage data (v led_pw and v comx ) is the raw data read from the adc. multiply by 0.05437489 to convert into a voltage. 7.4.7 pw - pwm status syntax: pw [ch] parameters: ? ch [0-3]: channel number output: ? retrieves the tim_cnt values configured in the [ch] channel. the command "pw 0" output is shown in figure 12 : status: err=0 cnt=0 di=1:050 led ch=0 on l=1 d=010 led=6 cur=0 vpw=432 vcom=80 ovc=off led ch=1 on l=1 d=020 led=6 cur=3 vpw=432 vcom=89 ovc=off led ch=2 on l=1 d=210 led=6 cur= 2 vpw=429 vcom=91 ovc=off led ch=3 on l=1 d=0 55 led=6 cur= 1 vpw=430 vcom=94 ovc=off am16711v1
user interface AN4291 32/53 docid024519 rev 1 figure 12. "pw" command it reports the channel status (on or off) and the tim_cnt counters for states s0, s1 and s2, frozen at the moment when the command is invoked. the counters in s0, s1 and s2 are based on the 964 mhz clock unit. the command also reports the dimming period ("d=32"). in this case, the value is the dimming period and starts from 1 (0.4%) and ends to 256 (100%). 7.4.8 vp - set v led_pw simulated voltage the command is used during the voltage compensation simulation phase ("au ch 1") to change the simulated voltage read from the v led_pw adc pin. this command is enabled only when the adaptive voltage compensation is disabled ("au ch 0" command). syntax: vp [ch] [voltage] parameters: ? ch [0-3]: channel number ? the parameter represents the new simulated voltage value, expressed as (real voltage / 0.05437489) output: none example: "vp 0 590": simulates the power voltage at 32.08 volt. 7.4.9 vc - set v comx simulated voltage the command is used during the voltage compensation simulation phase ("au ch 1") to change the simulated voltage read from the v comx adc pin. this command is enabled only when the adaptive voltage compensation is disabled ("au ch 0" command). syntax: vc [ch] [voltage] parameters: ? ch [0-3]: channel number ? voltage [0-1023]: same as the "vp" command output: none 7.4.10 wi - cpu load monitor and low power mode the command enables the cpu load monitor where the cpu load can be observed via the green led on the demonstration board. the command also enables the stlux385a low power mode by using the wfi (wait for interrupt) instruction when idle. the "wi" command is used to reduce the power consumption of the stlux385a. 7.4.11 dm - dump memory it displays the memory content of a specific area of memory. syntax: dm [add] [len] am16712v1 led ch=0 on s0=156 s1=276 s2=939 d=32
docid024519 rev 1 33/53 AN4291 user interface parameters: ? add: the memory address. it is possible to use a hexadecimal value using the "0x" prefix. the total memory area available on the stlux385a is 64 kbyte. ? len: total length of memory to be retrieved, in bytes. "0x" can be used as prefix for a hexadecimal number. output: ? the memory content starting from [add] address and [len] bytes long. 7.4.12 rr - read memory, single byte the command reads and displays the specified byte of memory. syntax: rr [add] parameters: ? add: the memory address. it is possible to use a hexadecimal value using the "0x" prefix. the total memory area available on the stlux385a is 64 kbyte. output: the byte located at [add] address 7.4.13 rw - write memory, single byte the command writes a single byte of memory. the incorrect use of this command could overwrite internal registers and change the behavior of the device and could cause the destruction of the demonstration board. syntax: rw [add] [dat] parameters: ? add: the memory location to write. it is possible to use a hexadecimal value using the "0x" prefix. the total memory area available on the stlux385a is 64 kbyte. ? dat: the byte to be written. it is possible to use a hexadecimal value using the "0x" prefix. output: none 7.4.14 ed - enable global dimming function it enables or disables the global dimming function. when the function is enabled, the "di" command applies to all channels. at the same time, the "+" and "-" buttons operate in global dimming mode. when the function is disabled, the "di" command is disabled and the led dimming can only be changed via the "ll" command. besides, the "+" and "-" buttons control a single channel. the [ed] value is stored into the e 2 prom data area for its read back at the next power-on. on reset, should "ed" be enabled, the last "ll" dimming value is not applied immediately but with a gradual light increment (from 0% to the "ll" value). syntax: ed [enable] parameters: ? enable [0,1]: enables or disables the global dimming function. output: none
user interface AN4291 34/53 docid024519 rev 1 7.4.15 di - set global dimming value it sets the dimming of the led strings to be used when the board is operating in global dimming mode ("ed 1"). at power-on the "di" value applied is 100 (equal to 100%) after a ramp-up period only if "ed" command is enabled. syntax: di [value] parameters: ? value [0,100]: the percentage of the value configured with the "ll" command. the global dimming is applied to all channels. output: none example: "ll 0 220", "di 50". channel 0 is dimmed at 220 @ 50% = 110. all other channels are dimmed at 50% of the their current dimming value. 7.4.16 ti - re ad time counter it retrieves the time since the last power-up or reset. syntax: ti parameters: none figure 13. console screen for "ti" command output: the time counter, in hexadecimal. the output is composed of two parts, separated by the comma sign. the first part shows the number of seconds elapsed since power-on or reset. the second part is the tick: a number from 0 to 191 (in hex: 0x00 to 0xbf) that represents the number of dimming period elapsed. one dimming period is exactly 5.1813 ms (193 hz). 7.4.17 co - clear error it clears any system error. this command clears ("off") the error code, removes the ocp flag monitored by the "st" command and switches off the fault led. the command does not clear the error counter tracked by the "st" command. the fault led may remain switched on after the "co" command if the cause of error has not been removed. syntax: co parameters: none 7.4.18 hl - command help it visualizes a brief description of the command selected. syntax: hl [command] parameters: ? command: a terminal command output: the description of the command selected. am16713v1 time is 0x00000098: 7d
docid024519 rev 1 35/53 AN4291 user interface 7.4.19 hl - ? - global help it displays a list of all accepted commands. syntax: ? hl ? ? parameter: none output: the list of all accepted commands. 7.5 error codes the stlux385a firmware performs several system checks during its execution. when an error is found: 1. the red fault led is triggered. 2. the error counter is incremented. 3. the error code is stored in an internal variable. the last error code is reported by the status command ("st"). the fault led can only be reset via the "co" command. the "co" command also clears the error code. the error counter is never reset. the following table describes the error codes: table 3. error codes code mnemonic meaning action 0 err_no_err no error n/a 1 err_pw power voltage under or upper the limit at power-on dimming off 2 err_max_f pwm frequency is over the limit n/a 3 err_min_f pwm frequency is under the limit n/a 4 err_flash error while writing in flash the last serial command is not stored into e 2 prom 5 err_ovc overcurrent protection (ocp). preventing short- circuit or overcurrent point dimming off 6 err_max_v main input voltage over the upper limit (50 v) v 7 err_min_v main input voltage too low to drive the configured number of leds. n/a 8 err_min_l power voltage across the inductance lower the limit (lower than 2.8 v) dimming off 9 err_max_l led voltage over the maximum. n/a 10 err_min_d number of leds below the limit (< 3 leds) n/a 11 err_vol_l led voltage drop below the minimum n/a 12 err_dali failure on the dali i/f ? only when dali fw is enabled dali error
measurements AN4291 36/53 docid024519 rev 1 8 measurements this section reports several measurement results validating the steval385led4ch demonstration board performance. 8.1 output current precision for different current setup figure 14 shows the current flow through the leds, measured with a current probe on all four channels. the operating current of all channels is the point 0 in ta ble 1 (245 ma mean). note the channel has delayed startup point and the current precision on all channels displayed. r1 is channel zero, r2 is channel two, r3 is channel three and 3 is channel four. the dimming periods, same for all channels, is ~5 ms (193 hz). figure 14. current regulation - 4 channels at 245 ma the following picture represents the different current regulation on the same channel and at the same dimming level. the current has changed using the "lc" command using, as second parameter, the index of the expected current. the vertical grid resolution is 100 ma/div. see ta ble 1 for the index and current relation. am16714v1
docid024519 rev 1 37/53 AN4291 measurements figure 15. current regulation - same channels, different current setup next picture shows a single channel with different dimming levels. the dimming values are: r1 = 20 units (7.8%); r2 = 50 units (19.5%); r3 = 150 units (58.6%); r4 = 200 units (78.1%); 3 = 255 units (99.6%). the off phase of the 3 line is equal to one dimming unit corresponding to 1/256 parts of 5,12 ms (~20 s). figure 16. current regulation - same channels, different dimming am16715v1 am16716v1
measurements AN4291 38/53 docid024519 rev 1 8.2 efficiency according to different current setup the following table shows the efficiency reached based on different number of leds. all 4 channels are using the same current. the measure reports the minimum, average and maximum efficiency for a configured fixed current on all input power voltage range. the current is calculated based on tab le 1 . the plots use "y" axis representing the efficiency, expressed as a percentage. the board configuration is with the led always on ("ll x 256" and, if "ed" is enabled, "di 100"). the best efficiency value measure is 98%. since the board is designed to be "generic" and supports a wide range of configurations (led numbers, power voltage range, etc.) the efficiency reaches 85% in some cases. the input board power when the pwm outputs are disabled (the led strings are off) is ~300 mw@12 v and ~600 mw@48 v. figure 17. string efficiency based on different current levels - 3 leds for each string table 4. efficiency according to different current when the input voltage changes plot index average current efficiency 3 leds 6 leds 10 leds min. mean max. min. mean max. min. mean max. 1 245 ma ( lc x 0 ) 92.8 93.4 94.5 92.5 94.2 95.8 96.0 97.3 98.5 2 329 ma ( lc x 1 ) 92.1 92.6 94.1 93.7 95.0 96.5 95.5 96.0 96.5 3 492 ma ( lc x 3 ) 91.1 91.6 92.1 94.4 95.1 96.1 95.9 96.0 96.2 4 738 ma ( lc x 6 ) 89.2 89.5 89.9 94.1 94.8 95.2 95.3 95.4 95.5 5 1.065a ( lc x 10 ) 84.9 85.1 85.4 92.3 92.8 93.1 93.4 93.9 94.1 82.0 84.0 86.0 88.0 90.0 92.0 94.0 96.0 12345 3 led max. 3 led mean 3 led min. am16717v1
docid024519 rev 1 39/53 AN4291 measurements figure 18. string efficiency based on different current levels - 6 leds for each string figure 19. string efficiency based on different current levels - 10 leds each string 8.3 current regulation on input voltage the following graphs show the current regulation in relation to the input power voltage. the plots report the current on the "y" axis and the voltage on the "x" axis. the input power voltage in every figure is the effective voltage range only for the number of leds selected. 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 12345 6 led max. 6 led mean 6 led min. am16718v1 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 12345 10 led max. 10 led mean 10 led min. am16719v1
measurements AN4291 40/53 docid024519 rev 1 figure 20. current regulation vs. v pw_led : 3 leds figure 21. current regulation vs. v pw_led : 6 leds 0.000 0.200 0.400 0.600 0.800 1.000 1.200 13v 16v 20v 24v 28v 32v 36v 40v 44v 48v 1.065a 738ma 492ma 329ma 254ma am16720v1 0 0.2 0.4 0.6 0.8 1 1.2 12v 16v 20v 24v 28v 32v 36v 40v 44v 48v 1.065a 738ma 492ma 329ma 254ma am16721v1
docid024519 rev 1 41/53 AN4291 measurements figure 22. current regulation vs. v pw_led : 10 leds 8.4 current regulation validation the tab le 5 compares the real current values, as captured by the oscilloscope, with the expected ones as configured by the user. the input power voltage is fixed and set at the middle of the usable range. the current is the mathematical average current (not the peak current) as got and calculated by the scope. 8.5 ocp protection time figure 23 , figure 24 and figure 25 show the current protection reaction time. the current working point is fixed at 245 ma in the first plot, at 738 ma in the second and at the 0 0.2 0.4 0.6 0.8 1 1.2 13v 16v 20v 24v 28v 32v 36v 40v 44v 48v 1.065a 738ma 492ma 329ma 254ma am16722v1 table 5. current regulation discrepancies command 3 leds ? 20 v 6 leds ? 32 v 10 leds ? 44 v expected lc x 0 0.251 a 0.254 a 0.255 a 0.245 a lc x 1 0.329 a 0.333 a 0.333 a 0.329 a lc x 2 0.407 a 0.414 a 0.413 a 0.410 a lc x 3 0.486 a 0.493 a 0.492 a 0.492 a lc x 4 0.563 a 0.571 a 0.570 a 0.574 a lc x 5 0.639 a 0.647 a 0.646 a 0.648 a lc x 6 0.715 a 0.725 a 0.724 a 0.738 a lc x 7 0.791 a 0.802 a 0.800 a 0.819 a lc x 8 0.867 a 0.879 a 0.877 a 0.901 a lc x 9 0.943 a 0.957 a 0.955 a 0.984 a lc x 10 1.016 a 1.031 a 1.030 a 1.065 a
measurements AN4291 42/53 docid024519 rev 1 maximum current (1.065 a) in the third. in all pictures, the blue track (2) shows the mosfet gate signal while the purple track (3) displays the output current when the output is shorted. the cycle starts every 5.12 ms. figure 23. mosfet gate during short-circuit - 245 ma figure 24. mosfet gate during short-circuit - 738 ma
docid024519 rev 1 43/53 AN4291 measurements figure 25. mosfet gate during short-circuit - 1.065 a
pinout AN4291 44/53 docid024519 rev 1 9 pinout ta ble 6 describes the stlux385a pinout and the associated function. table 6. stlux385a pinout pin dir. function note 1 out pwm[0] pwm - led chain 0 2 out/in digin[0]/cco_clk internal clock check output ? (option) 3 in digin[1] dig1 4 out pwm[1] pwm - led chain 1 5 out pwm[2] pwm - led chain 2 6 in digin[2] dig0 7 in digin[3] dig3 8out pwm[5] output to r/c ? voltage reference on cpm3 (led0) ? (optional) 9 i/o swim debug interfaces 10 i/o resetn to reset key and debug i/f 11 ps vdd power to 3.3 v or 5 v 12 ps vss digital gnd 13 ps vout filter capacitance for 1.8 v internal voltage 14 out led (red) fault signaling or dali tx line 15 out led (green) normal signaling (blink) or dali rx line 16 out pwm[4] option ? pwm for the dc-dc converter 17 in digin[4] dig2 18 in digin[5] not used or dali key input (option) 19 out pwm[3] pwm - led chain 3 20 osc_out external oscillator or fw trigger used to debug application 21 osc_in external oscillator or fw trigger used to debug application 22 out uart tx serial tx line 23 in uart rx serial rx line 24 a-in cpp3 compare 3 ? led chain 0 25 a-in cpp2 compare 2 ? led chain 1 26 a-in cpm3 connect to pwm[5] ? chain 0 current (5 ma/step) ? (option) 27 a-in cpp1 compare 1 ? led chain 3 28 a-in cpp0 compare 0 ? led chain 2
docid024519 rev 1 45/53 AN4291 pinout note: when the dali i/f is used, please remove r78, r77 resistor (lose run-fault function), enable the "use_dali" constant on the "led.h" source file, recompile and load the new code.to request the source code for the dali stack, please contact your local st representative. the steval-ilm001v1 kit gives access to the dali hardware interface. 29 ps vdda analog power supply 30 ps vssa analog ground 31 a-in adcin[7] key input ? voltage depends whether key is pressed or not 32 a-in adcin[6] external dimming signal ? 0 -10 v equal to 0% 100% ? (option) 33 a-in adcin[5] not used 34 a-in adcin[4] analog input ch4 ? v com3 ? voltage from led3 chain 35 a-in adcin[3] analog input ch3 ? v com2 ? voltage from led2 chain 36 a-in adcin[2] analog input ch2 ? v com1 ? voltage from led1 chain 37 a-in adcin[1] analog input ch1 ? v com0 ? voltage from led0 chain 38 a-in adcin[0] analog input ch0 ? adcin0 ? voltage on v led_pw signal (v in ) table 6. stlux385a pinout (continued) pin dir. function note
schematic diagram AN4291 46/53 docid024519 rev 1 10 schematic diagram figure 26. schematic - stlux385a - top u1 stmlux38 vddio 11 vdda 29 vout 13 gndio 12 gnda 30 gpio1[0]/pwm[0] 1 gpio1[1]/pwm[1] 4 gpio1[2]/pwm[2] 5 gpio1[3]/pwm[3] 19 gpio1[4]/pwm[4] 16 gpio1[5]/pwm[5] 8 gpio0[0]/uart_tx 22 gpio0[1]/uart_rx 23 gpio0[2]/i2c_sda/hseoscout 20 gpio0[3]/i2c_scl/hseoscin 21 gpio0[4]/dali_tx 14 gpio0[5]/dali_rx 15 nrst 10 swim 9 adcin[7] 31 adcin[6] 32 adcin[5] 33 adcin[4] 34 adcin[3] 35 adcin[2] 36 adcin[1] 37 adcin[0] 38 cpp[3] 24 cpp[2] 25 cmp3 26 cpp[1] 27 cpp[0] 28 digin[0]/cco_clk 2 digin[1] 3 digin[2] 6 digin[3] 7 digin[4] 17 digin[5] 18 j2 dali i/f 1 2 3 4 5 6 7 8 9 10 11 12 uart_tx uart_rx r9 0r hse - 16mhz cpp to monitor 4 led chain current gnd status cco - output to tp - test purpose p1 reset vcc r7 1k d1 fault remove r when use dali i/f d2 run dali_tx dali_rx dali i/f using steval-ilm001v1 x1 1 6 mh z- n . m. 1 3 c5 12p-n.m. key _dali r6 1k c6 12p-n.m. l8 we-cbf key _dali gnd gnd gnd gnd dig2 red c4 1uf gnd r1 0r vcc r2 0r swim gnd r3 0r resn c2 10nf gnd green vcc l1 we-cbf rs-669-4005 vcca c3 100nf gnd l9 we-cbf gnd l11 we-cbf vcca vcc r72 26k1 r75 26k1 l10 we-cbf r76 1k2 near the power pin j11 dimming 0-10v 1 2 gnd swim i/f r4 15k c7 4.7nf gnd pwm5 tp1 gnd resn pwm5 vreg_vcc led chain led chain pwm0 pwm1 pwm2 pwm3 cpp0 cpp1 c pp2 cpp3 led_pw vled0 vled1 vled2 vled3 dig0 dig1 dig2 dig3 pwm0 pwm1 pwm2 pwm3 pwm2 pwm0 pwm3 pwm1 power power adcin0 led_pw dig0 dig1 dig3 dig2 pwm4 cpp0 cpp1 dig1 dig3 dig0 cpp2 cpp3 r10 3.3k j4 uart i/f 1 4 5 uart_tx uart_rx cpp2 cpp1 gnd cpp0 cpp3 r11 47k r12 100k j3 1 2 3 adcin0 uart_tx gnd uart_rx adcin0 ld_pw + c1 1uf 10v tp11 usb to uart ttl (3,3v) not used j1 swim i/f 1 2 3 4 r5 4k7 r71 100k n.m. gnd vcc r74 100k n.m. vcc swim tp16 gnd c46 100nf c45 10nf gnd tp18 gnd tp17 vcc is 3.3v vcc r73 100k all tp is a smd test point r8 51.1k gnd r13 27k gnd sp1 sp2 tp6 tp7 vkey except tp on gnd and power vkey tp13 tp2 tp3 sp1 sp2 r77 0r vcc r78 0r p2 led ch sel 1 3 2 4 p3 inc 1 3 2 4 c8 10nf gnd p4 dec 1 3 2 4 gnd gnd gnd gnd gnd gnd tp12 tp15 tp14 vcc vled0 vled1 vled3 vled2 gnd tp8 dali_rx dali_tx vled0 vled2 vled3 vled1 am16726v1
docid024519 rev 1 47/53 AN4291 schematic diagram figure 27. schematic - 4 channel led driver cpp2 q2 stn3nf06l 1 2 3 4 d5 stps0560z rs-250-347 1 2 gnd gate_pwm2 c23 10nf 100v q3 2n7002 1 3 2 r32 n.m. r48 1r8 1w 1% vled1 vled3 gnd r40 26k1 c49 100nf gnd vd_10 led_pw r20 10r j6 ch0 1 2 vcca1 r25 26k1 vled2 r18 26k1 r41 26k1 d4 stps2h100a rs-249-612 2 1 gnd gnd r37 1k2 d3 stps2h100a rs-249-612 2 1 gnd vled1 + c10 1uf 100v gnd gnd r42 10r pwm2 r23 160r c16 10nf pwm0 gnd d13 ll4148 r33 n.m. gnd vled2 cut freq = 723 khz gnd dig1 d9 stps2h100a rs-249-612 2 1 gnd vcca1 cpp1 r22 160r gnd r15 n.m. + vcca1 c15 10nf 82ma step gnd r21 10r q4 2n7002 1 3 2 vcca1 pwm1 gate_pwm1 r17 n.m. + c24 1uf 100v q6 stn3nf06l 1 2 3 4 cpp0 tp10 gnd gnd l5 470uh 1,2a sat 1 2 gnd gnd c31 100nf + gnd u3 pm8834 1 2 3 4 5 6 7 8 en1 pwm1 gnd pwm2 out2 vcc out1 en2 vled0 track - high impedence - protect to sw current - + u6 lmv321ilt 1 3 4 5 2 pwm0 led_pw dig2 j5 ch2 1 2 vled3 c32 100nf gnd u2 pm8834 1 2 3 4 5 6 7 8 en1 pwm1 gnd pwm2 out2 vcc out1 en2 c18 10nf r54 n.m. - track - high impedence - protect to sw current gnd + c22 1uf 100v cpp0 track - high impedence - protect to sw current d8 ll4148 gate_pwm0 r53 n.m. pwm2 gnd r47 26k1 led_pw r27 1r8 1w 1% r36 1k2 gnd r39 5k1 j8 ch1 1 2 c14 1nf cut freq = 723 khz gnd gnd from 350ma to 1a vled0 r14 n.m. cpp3 gnd q1 stn3nf06l 1 2 3 4 led_pw r34 n.m. r49 1r8 1w 1% r50 1r8 1w 1% d6 stps0560z rs-250-347 1 2 from 350ma to 1a c19 100nf 82ma step c17 10nf gate_pwm0 c29 10nf gnd d10 stps2h100a rs-249-612 2 1 r61 5k1 gate_pwm3 c11 10nf 100v l2 470uh 1,2a sat 1 2 gnd gate_pwm0 gnd r29 1r8 1w 1% from 350ma to 1a - r31 n.m. vd_10 cpp3 r43 10r + r16 n.m. d12 stps0560z rs-250-347 1 2 vled2 tp9 c30 10nf led_pw gnd d14 ll4148 gnd gate_pwm1 r59 1k2 r38 5k1 q7 2n7002 1 3 2 q8 2n7002 1 3 2 cut freq = 723 khz ?? gnd gnd r45 160r dig0 tp22 c48 100nf ?? gate_pwm2 l4 470uh 1,2a sat 1 2 gnd gnd r26 1r8 1w 1% r44 160r vd_10 gate_pwm3 pwm3 ?? gnd vcca1 c25 1nf cut freq = 723 khz gnd vled0 - + u4 lmv321ilt 1 3 4 5 2 gnd tp19 gnd vcca1 vcca1 gate_pwm3 c20 100nf r56 n.m. gnd gate_pwm2 r58 1k2 dig0 82ma step - + u5 lmv321ilt 1 3 4 5 2 c27 10nf c26 1nf r55 n.m. gnd gnd gnd c28 10nf dig2 tp21 c13 1nf r35 n.m. vled3 r60 5k1 track - high impedence - protect to sw current - l3 470uh 1,2a sat 1 2 q5 stn3nf06l 1 2 3 4 gnd vcca1 gnd r46 26k1 gnd gate_pwm1 r51 1r8 1w 1% gnd + pwm3 r24 26k1 gnd r19 26k1 cpp1 from 350ma to 1a r57 n.m. gnd vd_10 c9 10nf 100v d11 stps0560z rs-250-347 1 2 - c21 10nf 100v vled1 r30 n.m. r52 n.m. r28 1r8 1w 1% cpp2 dig3 + c12 1uf 100v j7 ch3 1 2 tp20 82ma step d7 ll4148 - + u7 lmv321ilt 1 3 4 5 2 pwm1 dig1 dig3 am16727v1
schematic diagram AN4291 48/53 docid024519 rev 1 figure 28. schematic power section led_pw r65 2k7 adcin0 vd_10 gnd vcc vd_10 l6 8,5uh rs-574-582 1a isat - 0.22ohm 1 2 + c39 150uf 16v u9 lk112m33tr rs-686-9013 out 4 vin 5 shdn 1 gnd 2 by pass 3 gnd gnd d16 stps3l60u rs-486-2723 2 1 gnd gnd c38 100nf r66 10k c34 100nf 100v c42 100nf gnd gnd gnd + - vcca1 c40 100nf gnd - + u10 lmv321ilt 1 3 4 5 2 d15 bzv85-c51v 51v 1,3w r62 10r 1w 100ma max 9,35v output 3.3v 4a pcb trak + c50 47uf 100v + c41 10uf 10v vcca1 vcc gnd gnd gnd c37 100nf 100v acdin0 c44 100nf gnd vcca1 r67 26k1 r70 1k2 gnd r68 n.m. l7 we-cbf rs-669-4005 j9 conn-2poli 1 2 3 4 u8 st1s14 dk-497-10816-1-nd boot 1 fb 4 vin 7 en2 5 en1 3 gnd 6 sw 8 pgood 2 exp_pad 9 c35 150pf c43 10nf c33 100nf gnd r69 26k1 c47 100nf gnd + c36 22uf 100v en1 r64 10k led_pw r63 18k led_pw am16728v1
docid024519 rev 1 49/53 AN4291 bill of material 11 bill of material table 7. bill of material item quantity references part value package and supplier code notes 12 c1,c4 1 f capc-0603 10 v 2 4 c2,c8,c43,c45 10 nf capc-0603 38 c3,c19,c20,c31,c32, c40, 100 nf capc-0603 c44,c46 4 2 c5,c6 12p-n.m. capc-0603 not mounted 5 1 c7 4.7 nf capc-0603 6 4 c9,c11,c21,c23 10 nf capc-1206 100 v 7 4 c10,c12,c22,c24 1 f capc-1206 100 v 8 4 c13,c14,c25,c26 1 nf capc-0603 98 c15,c16,c17,c18,c27, c28,c29,c30 10 nf capc-0603 10 6 c33,c38,c42,c47,c48, c49 100 nf capc-0603 25 v 11 2 c34,c37 100 nf capc-1206 100 v 12 1 c35 150 pf capc-0805 25 v 13 1 c36 22 f d250p100 100 v 14 1 c39 150 f capc-7343 16 v 15 1 c41 10 f v-3216 10 v 16 1 c50 47 f cap- axp1000d400 100 v 17 1 d1 fault ledc-0603 18 1 d2 run ledc-0603 19 4 d3,d4,d9,d10 stps2h100a sma 20 4 d5,d6,d11,d12 stps0560z sod123 21 4 d7,d8,d13,d14 ll4148 sod80-st 22 1 d15 bzv85-c51v do41 51 v 1,3 w 23 1 d16 stps3l60u smb 24 1 j1 swim i/f 4 pin-pitch 2.54 25 1 j2 dali i/f pin 2x6 pitch 2.54 26 1 j3 uart i/f - ttl 3 pin-pitch 2.54
bill of material AN4291 50/53 docid024519 rev 1 27 1 j4 uart i/f jack-3_5- 35rasmt2bhnt rx 28 1 j5 ch2 2 way connector wago-250-402 29 1 j6 ch0 2 way connector wago-250-402 30 1 j7 ch3 2 way connector wago-250-402 31 1 j8 ch1 2 way connector wago-250-402 32 1 j9 2 way connector 2 way connector wago-236-402 33 1 j11 dimming 0 -10 v 2 pin-pitch 2.54 34 2 l1,l7 we-cbf capc-0603 35 4 l2,l3,l4,l5 470 h ds5022p-coilcraft 1,2 a sat 36 1 l6 8,5 h ell4gg panasonic 37 4 l8,l9,l10,l11 we-cbf capc-0603 38 1 p1 reset evqpsm panasonic 39 1 p2 led ch sel smd-switch-b3fs 40 1 p3 inc smd-switch-b3fs 41 1 p4 dec smd-switch-b3fs 42 4 q1,q2,q5,q6 stn3nf06l sot223 43 4 q3,q4,q7,q8 2n7002 sot23 44 10 r1,r2,r3,r9,r77,r34, r35,r56, r57,r68,r78 0r resc-0603 45 1 r4 15 k resc-0603 46 1 r5 4k7 resc-0603 47 2 r6,r7 1 k resc-0603 48 1 r8 51.1 k resc-0603 49 1 r10 3.3 k resc-0603 50 1 r11 47 k resc-0603 51 2 r12,r73 100 k resc-0603 52 1 r13 27 k resc-0603 table 7. bill of material (continued) item quantity references part value package and supplier code notes
docid024519 rev 1 51/53 AN4291 bill of material 53 8 r14,r15,r16,r17,r32, r33, r54,r55 n.m. resc-0603 not mounted 54 12 r18,r19,r24,r25,r40, r41,r46,r47,r67,r69, r72,r75 26k1 resc-0603 55 4 r20,r21,r42,r43 10r resc-0603 56 4 r22,r23,r44,r45 160r resc-0603 57 8 r26,r27,r28,r29,r48, r49,r50,r51 1r8 r2512 1 w 1% 58 4 r30,r31,r52,r53 n.m. resc-0805 not mounted 59 6 r36,r37,r58,r59,r70, r76 1k2 resc-0603 60 4 r38,r39,r60,r61 5k1 resc-0603 61 1 r62 10r r700diam100 1 w 62 1 r63 18 k resc-0805 63 2 r64,r66 10 k resc-0805 64 1 r65 2k7 resc-0805 65 2 r71,r74 100 k resc-0603 not mounted 66 1 u1 stmlux38 tssop38 67 2 u2,u3 pm8834 soi8 68 5 u4,u5,u6,u7,u10 lmv321ilt sot23-5l not mounted 69 1 u8 st1s14 so8-ep-9 70 1 u9 lk112m33tr sot23-5l 71 1 x1 16 mhz-n.m. x32-3_2x2_5- mec not mounted table 7. bill of material (continued) item quantity references part value package and supplier code notes
revision history AN4291 52/53 docid024519 rev 1 12 revision history table 8. document revision history date revision changes 12-jun-2013 1 initial release.
docid024519 rev 1 53/53 AN4291 please read carefully: information in this document is provided solely in connection with st products. stmicroelectronics nv and its subsidiaries (?st ?) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described he rein at any time, without notice. all st products are sold pursuant to st?s terms and conditions of sale. purchasers are solely responsible for the choice, selection and use of the st products and services described herein, and st as sumes no liability whatsoever relating to the choice, selection or use of the st products and services described herein. no license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. i f any part of this document refers to any third party products or services it shall not be deemed a license grant by st for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoev er of such third party products or services or any intellectual property contained therein. unless otherwise set forth in st?s terms and conditions of sale st disclaims any express or implied warranty with respect to the use and/or sale of st products including without limitation implied warranties of merchantability, fitness for a particular purpose (and their equivalents under the laws of any jurisdiction), or infringement of any patent, copyright or other intellectual property right. st products are not authorized for use in weapons. nor are st products designed or authorized for use in: (a) safety critical applications such as life supporting, active implanted devices or systems with product functional safety requirements; (b) aeronautic applications; (c) automotive applications or environments, and/or (d) aerospace applications or environments. where st products are not designed for such use, the purchaser shall use products at purchaser?s sole risk, even if st has been informed in writing of such usage, unless a product is expressly designated by st as being intended for ?automotive, automotive safety or medical? industry domains according to st product design specifications. products formally escc, qml or jan qualified are deemed suitable for use in aerospace by the corresponding governmental agency. resale of st products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by st for the st product or service described herein and shall not create or extend in any manner whatsoev er, any liability of st. st and the st logo are trademarks or register ed trademarks of st in various countries. information in this document supersedes and replaces all information previously supplied. the st logo is a registered trademark of stmicroelectronics. all other names are the property of their respective owners. ? 2013 stmicroelectronics - all rights reserved stmicroelectronics group of companies australia - belgium - brazil - canada - china - czech republic - finland - france - germany - hong kong - india - israel - ital y - japan - malaysia - malta - morocco - philippines - singapore - spain - sweden - switzerland - united kingdom - united states of america www.st.com


▲Up To Search▲   

 
Price & Availability of AN4291

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X